<template>
	<view class="headBarWX">
		<view class="head-icon" v-if="show">
			<text class="icon-back" @tap="handlToBack">&#xe681;</text> |
			<text class="iconfont" @tap="handlToHome"></text>
		</view>
		<view :style="{color:color}">
			{{title?title:'标题'}}
		</view>
	</view>
</template>

<script>
	export default {
		name: "headBarWX",
		data() {
			return {

			};
		},
		props: ['title', 'show', 'color'],
		methods: {
			handlToBack() {
				uni.navigateBack();
			},
			handlToHome() {
				uni.switchTab({
					url: '/pages/home/home'
				});
			},
		}
	}
</script>

<style lang="scss">
	.headBarWX {
		width: 100%;
		height: 75px;
		font-size: $font-size-l-m;
		line-height: 80px;
		text-align: center;
		color: black;
		position: relative;
	}

	.head-icon {
		position: absolute;
		left: 8px;
		top: 26px;
		width: 90px;
		height: 33px;
		background-color: rgba(0, 0, 0, 0.4);
		color: white;
		line-height: 33px;
		border-radius: 15px;
		display: flex;
		justify-content: space-evenly;
	}
</style>